// 路由监听
function route(handle, pathname, res){
	console.log("有个请求要访问路由[%s]", pathname);
	// 有定义事件就执行
	if(typeof handle[pathname] === 'function'){
		return handle[pathname](res);
	}else{
		console.log("路由[%s]没有定义可执行的事件", pathname);
		res.writeHead(404, {"Content-Type": "text/plain;chartset=utf-8"});
		res.write('404 Not found');
		res.end();
	}
}

exports.route = route;